<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		#box{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
		}
	</style>
	<script>
		
		window.onload=function () {
			box = document.getElementById('box')
			btn = document.getElementById('btn')

			is = true;
			btn.onclick= function(){
				if(is){
					box.style.display ="none";
					is = false;
				}else{
					box.style.display ="block";
					is= true;
				}
			}
		}

	</script>
</head>
<body>
	<div id="box"></div>
	<button id="btn">点我</button>
</body>
</html>